Currently, most electronic devices charge a battery by acquiring direct current from a power adapter through a communication interface thereof. However, in the related art, in order to reduce charging time during charging the battery, the charging current may be enhanced by the power adapter to realize an aim of performing a quick charging on the battery. However, when charging the battery either in a conventional constant voltage mode or with increased charging current, if a charging current and/or charging voltage of the battery is too high during the charging, the battery will be damaged due to overvoltage and/or overcurrent charging. Therefore, in the related art, an overcurrent protection and/or an overvoltage protection cannot be realized for the battery when the power adapter performs a conventional charging or quick charging on the battery in the electronic device.